﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _27_RemoveElement
{
    class Program
    {
        static void Main(string[] args)
        {

        }

        private static int RemoveElement(int[] nums, int val)
        {
            int result = nums.Length;
            for (int i = 0; i < result; i++)
            {
                if (nums[i] == val)
                {
                    nums[i--] = nums[result-- - 1];
                }
            }
            return result;
        }
    }
}
